package com.nuo.admin.api;

import com.nuo.admin.base.mapper.SysUserMapper;
import com.nuo.admin.pojo.dto.AuthUserDTO;
import com.nuo.common.core.constant.DubboConstant;
import com.nuo.common.core.result.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * @author LGC
 * @date 2022/2/9 15:12
 */
@Slf4j
@AllArgsConstructor
@DubboService(version = DubboConstant.VERSION_1, retries = DubboConstant.RETRIES, timeout = DubboConstant.TIMEOUT)
public class UserProviderImpl implements UserProvider{
    private final SysUserMapper sysUserMapper;
    /**
     * 根据用户名获取认证信息
     *
     * @param username
     * @return
     */
    @Override
    public Result<AuthUserDTO> getAuthInfoByUsername(String username) {
        log.info("根据用户名获取认证信息");
        AuthUserDTO userAuthInfo = sysUserMapper.getAuthInfoByUsername(username);
        return Result.success(userAuthInfo);
    }
}
